<extend name="Public/base" />
<block name="body">
    <!-- 标题栏 -->
	<div class="main-title">
		<h2>文件上传管理</h2>
	</div>
	<div class="cf">
		<div class="fl">
			<a class="btn" href="{:U('File/addFile', $where)}">新 增</a>
	        <button class="btn ajax-post" url="{:U('changeStatus?method=resume')}" target-form="ids">启 用</button>
	        <button class="btn ajax-post" url="{:U('changeStatus?method=forbid')}" target-form="ids">禁 用</button>
	        <button class="btn ajax-post confirm" url="{:U('changeStatus?method=delete')}" target-form="ids">删 除</button>
        </div>

        <!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="slefts">
				文件类型：<select class="" name="file_type" id="file_type" url="{:U('File/fileList', array('file_type' => $where['file_type']), true, true)}">
					<foreach name="fileType" key="key" item="val">
						<if condition="$key eq $where['file_type']">
							<option value="{:U('File/fileList?file_type='.$key, '', '', true)}" selected>{$val}</option>
						<else />
							<option value="{:U('File/fileList?file_type='.$key, '', '', true)}">{$val}</option>
						</if>
					</foreach>
				</select>　
			</div>
		</div>
    </div>
    
	<!-- 数据列表 -->
	<div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">ID</th>
		<th class="">名称</th>
		<th class="">扩展名</th>
		<th class="">大小</th>
		<th class="">上传者</th>
		<th class="">上传时间</th>
		<th class="">更新时间</th>
		<th class="">状态</th>
		<th class="">操作</th>
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
			<td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
			<td>{$vo.id}</td>
			<td>{$vo.name}</td>
			<td>{$vo.ext}</td>
			<td>{$vo.size_format}</td>
			<td>{$vo.operator_name_type}</td>
			<td>{:date('Y-m-d H:i:s', $vo['create_time'])}</td>
			<td>{:date('Y-m-d H:i:s', $vo['create_time'])}</td>
			<td>{$vo.status_text}</td>
			<td>
				<a href="{:U('File/editFile', array('id' => $vo['id'], 'file_type' => $vo['file_type']))}">编辑</a>
				<a href="{:U('File/detailFile', array('id' => $vo['id']))}">详情</a>
			</td>
		</tr>
		</volist>
		<else/>
		<td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>

	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
<script type="text/javascript" charset="utf-8">
	//搜索功能
	$("#file_type").change(function(){
		window.location.href="{:U('File/fileList', '', false, true)}" + "/file_type" + $(this).val() ;//$(this).attr('url');
	});

    //导航高亮
    highlight_subnav('{:U('File/fileList')}');
    
</script>
</block>